<%= javascript_include_tag "_loader.js" %>

<h1>Add work order</h1>
 <% if flash[:notice] %>
    <div class="notice"><%= flash[:notice] %></div>
  <% end %>

<%= link_to "Back", :controller => "hello", :action => "index" %> 
<p>
<%= form_for @event, :url => { :action => "create" } do |f| %>
  <% if @event.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@event.errors.count, "error") %> prohibited this event from being saved:</h2>

      <ul>
      <% @event.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label "Work Order No." %><br />
    <%= f.text_field :title %>
  </div>
  
  <div class="field">
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </div>
  
  <div class="field">
	 <%= f.label "Work order type" %><br />
    <select name="event[workordertype_id]">
	<option value="">Select Workorder Type</option>
	<% @workordertype_data.each do |t| %>
		<option value="<%= t.id %>"><%= t.workorder_type %></option>
	<% end %>
    </select>
  </div>
  
  <div class="field">
    <%= f.label "work order date" %><br />
    <%= f.text_field :work_order_date %>
  </div>
    <div class="field">
    <%= f.label "Standard Time (Hours)" %><br />
    <%= f.text_field :standard_time %>
  </div>
  <div class="field">
    <%= f.label "Due date" %><br />
    <%= f.text_field :due_date %>
  </div>
  <div class="field">
    <%= f.label "priority" %><br />
    <%= f.text_field :priority %>
  </div>
  <div class="field">
    <%= f.label "customer name" %><br />
    <%= f.text_field :customer_name %>
  </div>
  <div class="field">
    <%= f.label "customer addrss" %><br />
    <%= f.text_field :customer_address %>
  </div>
    <div class="field">
    <%= f.label "contact person" %><br />
    <%= f.text_field :contact_person %>
  </div>
  <div class="field">
    <%= f.label "contact tel" %><br />
    <%= f.text_field :contact_tel %>
  </div>
    <div class="field">
    <%= f.label "contact e-mail" %><br />
    <%= f.text_field :contact_email %>
  </div>
    <div class="field">
    <%= f.label "sale order number" %><br />
    <%= f.text_field :sales_order_number %>
  </div>
    <div class="field">
    <%= f.label "reference number" %><br />
    <%= f.text_field :ref_num %>
  </div>
      
   <div class="field">
    <%= f.label "progress %" %><br />
    <%= f.text_field :progress %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>